<div class="articles form">
<?php echo $this->ExtendedForm->create('Article', array('novalidate' => 'novalidate'));?>
	<h3><?php echo __d('admin', 'Edit Article'); ?></h3>
	<div class="form-group row">
        <div class="col-sm-2">
            <label for="language">Language</label>
            <select name="language" id="language" class="form-control">
                <option value="vietnam">VietNam</option>
                <option value="english">English</option>
                <option value="japan">Japan</option>
            </select>
        </div>
    </div>
    <?php
		if(isset($this->request->params['named']['id'])) echo '<div style="display: none;">';
		echo $this->ExtendedForm->input('id', array_merge(array('label' => __d('admin', 'Id'))));
		if(isset($this->request->params['named']['id'])) echo '</div>';

        echo $this->ExtendedForm->input('category_id', array_merge(array('type' => 'hidden', 'value'=>'1', 'label' => __d('admin', 'Id'))));

		if(isset($this->request->params['named']['created_date'])) echo '<div style="display: none;">';
		echo $this->ExtendedForm->input('created_date', array_merge(array('label' => __d('admin', 'Created Date'))));
		if(isset($this->request->params['named']['created_date'])) echo '</div>';

		if(isset($this->request->params['named']['image'])) echo '<div style="display: none;">';
		echo $this->ExtendedForm->input('image', array_merge(array('type' => 'image', 'label' => __d('admin', 'Image'))));
		if(isset($this->request->params['named']['image'])) echo '</div>';
    ?>
    <div class="area-language" id="text-vietnam">
    <?php
        if(isset($this->request->params['named']['title'])) echo '<div style="display: none;">';
		echo $this->ExtendedForm->input('title', array_merge(array('label' => __d('admin', 'Title'))));
		if(isset($this->request->params['named']['title'])) echo '</div>';
        
		if(isset($this->request->params['named']['short_des'])) echo '<div style="display: none;">';
		echo $this->Form->input('Article.short_des', array_merge(array('type' => 'textarea', 'label' => __d('admin', 'Short Des'), 'class' => 'form-control', 'div' => 'form-group row', 'before' => '<div class="col-sm-10">', 'after' => '</div>')));
		if(isset($this->request->params['named']['short_des'])) echo '</div>';

		if(isset($this->request->params['named']['full_des'])) echo '<div style="display: none;">';
		echo $this->ExtendedForm->input('full_des', array_merge(array('label' => __d('admin', 'Full Des'))));
		if(isset($this->request->params['named']['full_des'])) echo '</div>';

	?>
    </div>
    <div class="area-language" id="text-english" style="display:none">
    <?php
        if(isset($this->request->params['named']['title_eng'])) echo '<div style="display: none;">';
		echo $this->ExtendedForm->input('title_eng', array_merge(array('label' => __d('admin', 'Title'))));
		if(isset($this->request->params['named']['title_eng'])) echo '</div>';
        
        if(isset($this->request->params['named']['short_des_eng'])) echo '<div style="display: none;">';
		echo $this->Form->input('Article.short_des_eng', array_merge(array('type' => 'textarea', 'label' => __d('admin', 'Short Des'), 'class' => 'form-control', 'div' => 'form-group row', 'before' => '<div class="col-sm-10">', 'after' => '</div>')));
		if(isset($this->request->params['named']['short_des_eng'])) echo '</div>';
        
		if(isset($this->request->params['named']['full_des_eng'])) echo '<div style="display: none;">';
		echo $this->ExtendedForm->input('full_des_eng', array_merge(array('label' => __d('admin', 'Full Des'))));
		if(isset($this->request->params['named']['full_des_eng'])) echo '</div>';

	?>
    </div>
    <div class="area-language" id="text-japan" style="display:none">
    <?php
        if(isset($this->request->params['named']['title_jpn'])) echo '<div style="display: none;">';
		echo $this->ExtendedForm->input('title_jpn', array_merge(array('label' => __d('admin', 'Title'))));
		if(isset($this->request->params['named']['title_jpn'])) echo '</div>';
        
        if(isset($this->request->params['named']['short_des_jpn'])) echo '<div style="display: none;">';
		echo $this->Form->input('Article.short_des_jpn', array_merge(array('type' => 'textarea', 'label' => __d('admin', 'Short Des'), 'class' => 'form-control', 'div' => 'form-group row', 'before' => '<div class="col-sm-10">', 'after' => '</div>')));
		if(isset($this->request->params['named']['short_des_jpn'])) echo '</div>';

		if(isset($this->request->params['named']['full_des_jpn'])) echo '<div style="display: none;">';
		echo $this->ExtendedForm->input('full_des_jpn', array_merge(array('label' => __d('admin', 'Full Des'))));
		if(isset($this->request->params['named']['full_des_jpn'])) echo '</div>';
	?>
    </div> 
<?php echo $this->ExtendedForm->end(array('label' => __d('admin', 'Save Article'), 'class' => 'btn btn-primary', 'div' => false, 'before' => '<div class="form-group">', 'after' => "\n" . $this->Html->link(__d('admin', 'Cancel'), $redirectUrl, array('class' => 'btn btn-default')) . '</div>'));?>
</div>
<script>
$(document).ready(function(){
    $('#language').change(function() {
        var lang = $(this).val();
        $('.area-language').hide();
        $('#text-' + lang).show();
    });
});
</script>